From 101c2f73716f517814eb55013704ab972badbb71 Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 23 Jun 2005 17:34:28 +0000 Subject: [PATCH] Make commaspace equiv to comma on csv read. --- csv_util.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/csv_util.c b/csv_util.c index efa433f03..7d0528999 100644 --- a/csv_util.c +++ b/csv_util.c @@ -185,6 +185,17 @@ csv_lineparse(const char *stringstart, const char *delimited_by, if (strcmp(delimited_by, "\\w") == 0) hyper_whitespace_delimiter = 1; + /* + * This is tacky. Our "csv" format is actually "commaspace" format. + * Changing that causes unwanted churn, but it also makes "real" + * comma separated data (such as likely to be produced by Excel, etc.) + * unreadable. So we silently change it here on a read and let the + * whitespace eater consume the space. + */ + if (strcmp(delimited_by, ", ") == 0) { + delimited_by = ","; + } + if (!p) { /* first pass thru */ p = stringstart; -- 2.30.2